Skip to content

d_a_ep work#2364

Merged
TakaRikka merged 8 commits intozeldaret:mainfrom
carter-ktb21:d_a_ep
Apr 1, 2025
Merged

d_a_ep work#2364
TakaRikka merged 8 commits intozeldaret:mainfrom
carter-ktb21:d_a_ep

Conversation

@carter-ktb21
Copy link
Copy Markdown
Contributor

No description provided.

/* 80468A70-80468A90 0008F0 0020+00 1/1 0/0 0/0 .text hahen_normal__FP8ep_classP10ep_hahen_s */
static void hahen_normal(ep_class* param_0, ep_hahen_s* param_1) {
// NONMATCHING
static void hahen_normal(ep_class* e_this, ep_hahen_s* i_this) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the use of e_this and i_this throughout the whole TU should be cleaned up to use i_this for ep_class and hahen_s for ep_hahen_s.

0x0103, 0x8112
};

cXyz local_1c = cXyz(e_this->field_0x634.x, e_this->field_0x634.y + -240.0f + 235.0f +15.0f, e_this->field_0x634.z);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just be cXyz sp1C(...

e_this->mSph1.OffAtSetBit();
}

e_this->mSph1.SetC(cXyz(e_this->field_0x634.x, e_this->field_0x634.y + 30.0f, e_this->field_0x634.z));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this cXyz should be put on the stack since it doesn't call a destructor immediately after

Comment on lines +572 to +575
JGeometry::TVec3<float> aTStack_88;
aTStack_88 = cStack_40;
JPABaseEmitter* emitter = (JPABaseEmitter*)e_this->field_0x610;
emitter->setDirection(aTStack_88);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldnt need to explicitly create a TVec3 here, just passing in a cXyz should implicitly do the conversion. also emitter shouldnt be stored to a temp var, you can just call the member var directly

Comment on lines +578 to +579
emitter = (JPABaseEmitter*)e_this->field_0x610;
emitter->becomeInvalidEmitter();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here, no temp needed


/* 8046A6D4-8046A6DC 002554 0008+00 1/0 0/0 0/0 .text daEp_IsDelete__FP8ep_class */
static bool daEp_IsDelete(ep_class* param_0) {
static bool daEp_IsDelete(ep_class* e_this) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns int

Comment on lines +795 to +810
rv = 0;
} else {
MtxScale(0.0f, 0.0f, 0.0f, 0);
e_this->mpModel->setBaseTRMtx(*calc_mtx);

modelData = (J3DModelData*)dComIfG_getObjectRes("Ep", 7);
JUT_ASSERT(0x884, modelData != 0);

for (int i = 0; i < 6; i++) {
e_this->mHahen[i].mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (e_this->mHahen[i].mpModel == NULL) {
return 0;
}
}
rv = 1;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using here as an example but probably in many other places in this TU, the rv temp isn't necessary. just return the value directly, and it'll also let you remove the unnecessary else block nesting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through and got rid of rv where it wasn't needed to match


e_this->field_0x5a4 = 0;
e_this->field_0x60d = 0;
e_this->cullMtx = e_this->field_0x570;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fopAcM_SetMtx


if (i_this->field_0xa5a < 0) {
#ifdef DEBUG
OSReport(" ///// EP PARAM %x\n");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the OS_REPORT macro to avoid having to wrap OSReport calls in ifdefs

@TakaRikka TakaRikka merged commit 3df4a4b into zeldaret:main Apr 1, 2025
1 check passed
@carter-ktb21 carter-ktb21 deleted the d_a_ep branch April 2, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants